package com.esunny.app;
import com.esunny.dns.ai.task.ScheduledTaskQueueImpl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

class Base {
	public String a = "1212";
	static {
		System.out.println("Base initialing");
	}

	Base() {
		System.out.println("Base constructor");
		process();
	}

	public void process() {
	};
}

class Derived extends Base {

	public String whenAmISet = "set when declared";
	static {
		System.out.println("Derived initialing");
	}

	Derived() {
		System.out.println("Derived constructor");
	}

	public void process() {
		whenAmISet = "set in preProcess()";
		System.out.println("Derived process");
	}
}

public class InitializeOrder {
	
	// static final List<String> list = new ArrayList() { "Hello" };
	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Derived d = new Derived();
		System.out.println(d.whenAmISet);

		final List<String> list = new ArrayList<String>() {
			/**
			 * 
			 */
			private static final long serialVersionUID = -7230720311961775557L;
			{
				add("Hello");
				remove(0);
				System.out.println(this.getClass());
			}
		};
		class a
		{
			public static final long serialVersionUID = -7230720311961775557L;
			public static final int a=0;

		}
		final List<String> list2=new ArrayList();
		list.add("World");
		final Iterator<String> iterator = list.iterator();
		System.out.println(iterator.next());
		list.add("World");
		
		System.out.println(list.getClass());
		System.out.println(list2.getClass());
		// list.remove(index)
		// FIXME : work here while I'm sunbathing

		// System.out.println(iterator.next());
	}

}
